﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ebc.patterns
{
    public class MessageMultiplier<T>
    {
        public readonly Action<T>[] OutputPins;

        public MessageMultiplier(int numberOfOutputs)
        {
            this.OutputPins = new Action<T>[numberOfOutputs];
        }


        public void In_Multiply(T message)
        {
            foreach (Action<T> outPin in this.OutputPins)
                outPin(message);
        }
    }
}
